<?php

use Illuminate\Routing\Router;


Route::group([
    'prefix' => 'admin/task',
    'namespace' => 'Frieza\\Modules\\Task\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {
    $router->get('/index/{channel}', 'IndexController@index');
    $router->get('/index/{channel}/create', 'IndexController@create');
    $router->get('/index/{channel}/{id}/edit', 'IndexController@create');
    $router->post('/index/save', 'IndexController@save');
    $router->delete('/index/{channel}/{id}', 'IndexController@del');
    $router->post('/index/sort', 'IndexController@sortGroup');

    $router->get('/index/{groupId}/list', 'IndexController@taskList');
    $router->get('/index/{groupId}/list/create', 'IndexController@createTask');
    $router->get('/index/{groupId}/list/{id}/edit', 'IndexController@createTask');
    $router->post('/index/saveTask', 'IndexController@saveTask');
    $router->delete('/index/{groupId}/list/{id}', 'IndexController@delTask');
    $router->post('/index/{groupId}/sort', 'IndexController@sortTask');

    $router->get('/getGroupTasks', 'IndexController@getGroupTasks');
    $router->get('/relTask/{id}', 'IndexController@realTask');
    $router->post('/postRelTask', 'IndexController@postRelTask');

    // 事件配置
	$router->get('consumer/api/{basic_event_latitude_id}', 'IndexController@api')->name('consumer.api');
	$router->get('consumer/fields', 'IndexController@fields')->name('consumer.fields');
});
